<?php
/**
 * Created by: i@fedax.cn
 * Date: 2018/7/16 22:35
 */

namespace app\admin\controller;

use app\admin\model\Withdrawal as WithdrawalModel;

class Withdrawal extends Index
{
    /**
     * @return \think\response\View
     */
    public function index(){
        return view();
    }

    /**
     * Notes: 提现总金额（成功提现and申请提现）
     * User: 王俊成
     * Date: 2018/10/24
     * Time: 17:19
     * @return \think\response\Json
     */
    public function countData(){
        $withdrawalModel = new WithdrawalModel();
        $result = $withdrawalModel->countData();
        return json($result);
    }
    /**
     * Notes: 提现数据查询（全部，申请，拒绝，成功）
     * User: 王俊成
     * Date: 2018/10/24
     * Time: 13:47
     * @return \think\response\Json
     * @throws \think\exception\DbException
     */
    public function withdrawalData(){
        $withdrawalModel = new WithdrawalModel();
        $data = $withdrawalModel->getDataList();
        return json($data);
    }

    /**
     * Notes: 申请提现
     * User: 王俊成
     * Date: 2018/10/23
     * Time: 17:43
     * @return \think\response\View
     */
    public function applyWithdrawalIndex(){
        return view();
    }

    /**
     * Notes: 拒绝提现
     * User: 王俊成
     * Date: 2018/10/24
     * Time: 17:50
     * @return \think\response\View
     */
    public function refuseWithdrawalIndex(){
        return view();
    }

    /**
     * Notes: 成功提现
     * User: 王俊成
     * Date: 2018/10/24
     * Time: 17:59
     * @return \think\response\View
     */
    public function successWithdrawalIndex(){
        return view();
    }

    /**
     * Notes: 用户信息
     * User: 王俊成
     * Date: 2018/10/26
     * Time: 9:50
     * @return \think\response\View
     */
    public function userInfo(){

        $withdrawalModel = new WithdrawalModel();
        $data = $withdrawalModel->getUserInfo();
//        return $data;
        return view()->assign('userData',$data);
    }
    /**
     * Notes: 处理提现申请
     * User: 王俊成
     * Date: 2018/10/25
     * Time: 15:47
     * @return \think\response\Json
     */
    public function dealwithApply(){
        $withdrawalModel = new WithdrawalModel();
        $result = $withdrawalModel->dealwithApply();
        return json($result);
    }

    /**
     * Notes: 批量处理提现申请
     * User: 王俊成
     * Date: 2018/10/27
     * Time: 14:11
     * @return \think\response\Json
     */
    public function batchDealwithApply(){
        $withdrawalModel = new WithdrawalModel();
        $result = $withdrawalModel->batchDealwithApply();
        return json($result);
    }

    /**
     * Notes: excel导出数据
     * User: 王俊成
     * Date: 2018/10/29
     * Time: 10:59
     */
    public function withdrawalDataExport(){
        $withdrawalModel = new WithdrawalModel();
        $withdrawalModel->withdrawalDataExport();
    }

    //单个用户的提现记录
    public function withdrawDetail()
    {
        $withdrawalModel = new WithdrawalModel();
        $data = $withdrawalModel->withdrawDetail();
        return view()->assign('data',$data);
    }

    //某个用户的的收到的礼物详情
    public function receiveGiftDetail()
    {
        $withdrawalModel = new WithdrawalModel();
        $data = $withdrawalModel->receiveGiftDetail();
        return view()->assign('data',$data);
    }
    //某个用户的的送出的的礼物详情
    public function sendGiftDetail()
    {
        $withdrawalModel = new WithdrawalModel();
        $data = $withdrawalModel->sendGiftDetail();
        return view()->assign('data',$data);
    }

}